org.eclipse.vtp.desktop.projects.core.internals
Class MediaFile

java.lang.Object
  extended by org.eclipse.vtp.desktop.projects.core.internals.VoiceResource
      extended by org.eclipse.vtp.desktop.projects.core.internals.MediaResource
          extended by org.eclipse.vtp.desktop.projects.core.internals.MediaFile
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, IMediaFile, IMediaResource, ObjectListener, IVoiceToolsResource
Direct Known Subclasses:
AudioFile, GrammarFile

public class MediaFile
extends MediaResource
implements IMediaFile

This is a concrete implementation of IMediaFile and provides the default behavior of that interface.

Version:
2.0
Author:
Trip Gilman

Constructor Summary
MediaFile(IMediaContainer container, org.eclipse.core.resources.IFile file)
          Creates a new MediaFile in the given container with the provided eclipse file resource.
 
Method Summary
 org.eclipse.core.resources.IFile getUnderlyingFile()
           
 long length()
          Returns the length of this media resource in number of bytes.
 java.io.InputStream open()
          Opens this media file resource and returns an InputStream to it's contents.
 
Methods inherited from class org.eclipse.vtp.desktop.projects.core.internals.MediaResource
delete, exists, getMediaPath, getName, getObjectId, getParent, getParentMediaContainer
 
Methods inherited from class org.eclipse.vtp.desktop.projects.core.internals.VoiceResource
addRefreshListener, deferEvents, finalize, getAdapter, getProject, processObjectEvent, refresh, removeRefreshListener, resumeEvents
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.vtp.desktop.projects.core.IMediaResource
delete, exists, getMediaPath, getParentMediaContainer
 
Methods inherited from interface org.eclipse.vtp.desktop.projects.core.IVoiceToolsResource
addRefreshListener, deferEvents, getName, getParent, getProject, refresh, removeRefreshListener, resumeEvents
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

MediaFile

public MediaFile(IMediaContainer container,
                 org.eclipse.core.resources.IFile file)
Creates a new MediaFile in the given container with the provided eclipse file resource.

Parameters:
container - The parent media container
file - The eclipse file resource this media file represents
Method Detail

open

public java.io.InputStream open()
                         throws org.eclipse.core.runtime.CoreException
Description copied from interface: IMediaFile
Opens this media file resource and returns an InputStream to it's contents.

Specified by:
open in interface IMediaFile
Returns:
An input stream to the resource contents
Throws:
org.eclipse.core.runtime.CoreException - If an error occured while opening the resource

length

public long length()
            throws org.eclipse.core.runtime.CoreException
Description copied from interface: IMediaFile
Returns the length of this media resource in number of bytes.

Specified by:
length in interface IMediaFile
Returns:
The number of bytes contained in this resource
Throws:
org.eclipse.core.runtime.CoreException - If an error occured while calculating the file length

getUnderlyingFile

public org.eclipse.core.resources.IFile getUnderlyingFile()